home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v9n02.arc
/
SUBROUTN.BAT
< prev
next >
Wrap
DOS Batch File
|
1990-01-02
|
592b
|
28 lines
@ECHO OFF
SET myvar=joker
REM ---v--- Put the name of the return label in e-var "return"
SET return=ret1
REM ---v--- Now jump to the subroutine
GOTO sub
REM ---v--- When the subroutine ends, it will jump to this label
:ret1
SET myvar=penguin
SET return=ret2
GOTO sub
:ret2
SET myvar=riddler
SET return=ret3
GOTO sub
:ret3
ECHO That's all!
GOTO end
REM ---------- This is the subroutine -- when finished it jumps to
REM ---------- the label whose name is stored in e-var "return"
:sub
ECHO The current value of myvar is "%myvar%"
PAUSE
GOTO %return%
:end